package com.situ.springboot.controller;

import com.situ.springboot.pojo.BanjiCountVO;
import com.situ.springboot.service.IBanjiService;
import com.situ.springboot.util.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/echarts")
public class EChartsController {
    @Autowired
    private IBanjiService banjiService;

    @RequestMapping("/getEChartsPage")
    public String getEChartsPage() {
        return "/WEB-INF/echarts.jsp";
    }

    @RequestMapping("/getBanjiCount")
    @ResponseBody
    public JSONResult getBanjiCount() {
        List<BanjiCountVO> list = banjiService.getBanjiCount();
        return JSONResult.ok(list);

    }

}
